// 重置密码
const layer = layui.layer
$('#form').on('submit',function(e){
   e.preventDefault()
   const data = $('#form').serialize()
   console.log(data);
   axios.post('/my/updatepwd',data)
   .then(({data}) => {
    console.log(data)
    if(data.status!==0){
      return layer.msg(data.message);
    }
    layer.msg(data.message,{time:2000},function(){
      window.parent.location.href="../login.html"
      
    });

   })
  
})
const form = layui.form
form.verify({
 pass: [
    /^[\S]{6,12}$/
    ,'密码必须6到12位，且不能出现空格'
  ] ,
  repwd(value){
    if(value!==$('[name="newPwd"]').val()){
      return '两次密码不一致'
    }
  },
  prepwd(value){
    if(value===$('[name="oldPwd"]').val()){
      return '新老密码相同'
    }
   }
});      